package org.example;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.support.MessageBuilder;

import javax.annotation.Resource;

/**
 * @Author: tang
 * @Description:
 * @Date 2024/5/27 16:52
 */
@EnableBinding(MyChannel.class)
public class SendService {

    @Resource
    private MyChannel myChannel;

    public void sendFaceMsg(String msg) {
        myChannel.faceOutput().send(MessageBuilder.withPayload(msg).build());
    }

    public void sendHumanMsg(String msg) {
        myChannel.humanOutput().send(MessageBuilder.withPayload(msg).build());
    }

    public void sendVehicleMsg(String msg) {
        myChannel.vehicleOutput().send(MessageBuilder.withPayload(msg).build());
    }

}
